home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / Projects / Questions & Answers / Q&A Programming Functions / On function parameter order < prev    next >
Encoding:
Text File  |  1998-10-26  |  628 b   |  27 lines  |  [TEXT/ScoM]

  1. RIGHT FUNCTION PARAMETER ORDER
  2.  
  3. There is a also a general rule in the functions that the processed 
  4. item should be the last one. This makes it easier to read nested 
  5. operations that occur very often in SCOM. Consider how easy it is to 
  6. read and modify this
  7.  
  8.  (dothis 1 2
  9.    (dothat 3 4
  10.      (domore 5 6
  11.        (andsoon 7 8))))
  12.  
  13. instead of
  14.  
  15.   (dothis 1
  16.      (dothat 
  17.         (domore
  18.            (andsoon 7 8)
  19.            5 6)
  20.         3
  21.         4)
  22.     2)
  23.  
  24. There are some exceptions due historical reasons, but all new
  25. functions should follow this guideline. It's so much easier to
  26. read the first than the Lisp-like second example. 
  27.